/* $Header: col_tbls.c,v 2.2 01/10/02 10:29:13 przybyls Exp $ */

/* pneu_tbls.c - workfile get/set for pneu setpoints */
/* wikfors; sometime in late 1992 */
/* Copyright (c) 1992, Hewlett-Packard Co. */

#include <typedefs.h>
#include <pcb_defs.h>
#include <error.h>
#include <p_wkfile.h>
#include <p_status.h>
#include <ramps.h>
#include <zone_config.h>
#include <method.h>
#include <p_ui.h>
#include <meth_config.h>


#define METH_RET_TIME METH_INT3
#define METH_RATE     METH_INT2
#define METH_PRES     METH_INT0
#define METH_FLOW     METH_INT0
#define METH_TIME     METH_INT2
#define METH_NUM      METH_INT0
#define METH_TEMP     METH_INT0
#define METH_ZONE_ERR METH_INT0

/* function prototypes */
UI_ERR NullFunc ( void *which );
void TurnInterruptsON ( void );
void TurnInterruptsOFF ( void );
UI_ERR DummyFunc        ( void *which );
UI_ERR LockPneuWkfile   ( void *which );
UI_ERR UnlockPneuWkfile ( void *which );

static INT32  mGetColDefined       ( void *status, U_INT8 unused_parm );
static INT32  mGetColControlMode   ( void *status, U_INT8 unused_parm );
static INT32  mGetColInitValue     ( void *status, U_INT8 unused_parm );
static INT32  mGetColInitTime      ( void *status, U_INT8 unused_parm );
static INT32  mGetColRate          ( void *status, U_INT8 ramp_num    );
static INT32  mGetColFinalValue    ( void *status, U_INT8 ramp_num    );
static INT32  mGetColFinalTime     ( void *status, U_INT8 ramp_num    );
static INT32  mGetColPresActual    ( void *status, U_INT8 unused_parm );
static INT32  mGetColFlow          ( void *status, U_INT8 unused_parm );
static INT32  mGetColVel           ( void *status, U_INT8 unused_parm );

static INT32  mGetColLength        ( void *status, U_INT8 unused_parm );
static INT32  mGetColDiam          ( void *status, U_INT8 unused_parm );
static INT32  mGetColFilmThick     ( void *status, U_INT8 unused_parm );
static INT32  mGetColSource        ( void *status, U_INT8 unused_parm );
static INT32  mGetColOutlet        ( void *status, U_INT8 unused_parm );
static INT32  mGetColVacuumComp    ( void *status, U_INT8 unused_parm );
static INT32  mGetColOutletPresComp( void *status, U_INT8 unused_parm );
static INT32  mGetColOutletPres    ( void *status, U_INT8 unused_parm );
static INT32  mGetColMinPeakWidth  ( void *status, U_INT8 unused_parm );
static INT32  mGetColRampType      ( void *status, U_INT8 unused_parm );

static INT32  mGetColCalibMode     ( void *status, U_INT8 unused_parm );
static INT32  mGetColMeasFlow      ( void *status, U_INT8 unused_parm );
static INT32  mGetColHoldTime      ( void *status, U_INT8 unused_parm );
static INT32  mGetColCalibLength   ( void *status, U_INT8 unused_parm );
static INT32  mGetColCalibDiam     ( void *status, U_INT8 unused_parm );
static INT32  mGetColCalibDate     ( void *status, U_INT8 unused_parm );
static INT32  mGetColIdString      ( void *status, U_INT8 unused_parm );

static INT32 mGetColPostValue     ( void *status, U_INT8 unused_parm );

static UI_ERR mSetColPostValue    ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mSetColControlMode   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColInitValue     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColInitTime      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColRate          ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetColFinalValue    ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetColFinalTime     ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetColPresSetpt     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColFlowSetpt     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColVelSetpt      ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mSetColLength        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColDiam          ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColFilmThick     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColSource        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColOutlet        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColVacuumComp    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColOutletPresComp( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColOutletPres    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColCalibMode     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColMeasFlow      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColHoldTime      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetColIdString      ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mAcceptCalibMode     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mAcceptColMeasFlow   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mAcceptColHoldTime   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mAcceptCalibLength   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mAcceptCalibDiam     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mAcceptCalibDate     ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mTestColRampType     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mTestColDefined      ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mLetColLength        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColDiam          ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColFilmThick     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColSource        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColOutlet        ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColVacuumComp    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColOutletPresComp( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetColOutletPres    ( void *status, INT32 setpt, U_INT8 unused_parm );


typedef INT32  (* const GET)(void *status, U_INT8 unused_parm);
typedef UI_ERR (* const SET)(void *status, INT32 setpt, U_INT8 unused_parm);



#if 0

static const METHCMD_ENTRY mmXXNC[] =
{
      { mGetColGasType,        mSetColGasType,      0,  METH_NUM  },
      { mGetColValueRange,     (SET)NullFunc,       0,  METH_PRES }
};


const METHCMD mC1NC =
{
        MAXINDEX(mmXXNC, METHCMD_ENTRY),
        &mmXXNC[0],
        (void *)&Inst_Status.Pneu.Col.Col_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mC2NC =
{
        MAXINDEX(mmXXNC, METHCMD_ENTRY),
        &mmXXNC[0],
        (void *)&Inst_Status.Pneu.Col.Col_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};

#endif


static const METHCMD_ENTRY mmXXPI[] =
{
      { mGetColPresActual,  mSetColPresSetpt,  0,  METH_PRES } 
};

const METHCMD mC1PI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mC2PI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};





static const METHCMD_ENTRY mmXXPW[] =
{
      { mGetColMinPeakWidth,  (SET)NullFunc,   0,  METH_INT3 } 
};

const METHCMD mC1PW =
{
        MAXINDEX(mmXXPW, METHCMD_ENTRY),
        &mmXXPW[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mC2PW =
{
        MAXINDEX(mmXXPW, METHCMD_ENTRY),
        &mmXXPW[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXFI[] =
{
      { mGetColFlow,        mSetColFlowSetpt,  0,  METH_PRES } 
};

const METHCMD mC1FI =
{
        MAXINDEX(mmXXFI, METHCMD_ENTRY),
        &mmXXFI[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mC2FI =
{
        MAXINDEX(mmXXFI, METHCMD_ENTRY),
        &mmXXFI[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXVI[] =
{
      { mGetColVel,         mSetColVelSetpt,   0,  METH_PRES } 
};

const METHCMD mC1VI =
{
        MAXINDEX(mmXXVI, METHCMD_ENTRY),
        &mmXXVI[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mC2VI =
{
        MAXINDEX(mmXXVI, METHCMD_ENTRY),
        &mmXXVI[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};


static INT32 CmdHasBeenSent( void *status, U_INT8 unused_parm )
{
    (void) status;   (void) unused_parm;
    return 1;
}
 

static const METHCMD_ENTRY mmXXNR[] =
{
      { CmdHasBeenSent,     (SET)NullFunc,      0,  METH_NUM  },
      { mGetColDefined,     mTestColDefined,    0,  METH_NUM  },
      { mGetColControlMode, mSetColControlMode, 0,  METH_NUM  },
      { mGetColRampType,    mTestColRampType,   0,  METH_NUM  },
      { mGetColInitValue,   mSetColInitValue,   0,  METH_NUM  },
      { mGetColInitTime,    mSetColInitTime,    0,  METH_TIME },
      { mGetColRate,        mSetColRate,        1,  METH_NUM  },
      { mGetColFinalValue,  mSetColFinalValue,  1,  METH_NUM  },
      { mGetColFinalTime,   mSetColFinalTime,   1,  METH_TIME },
      { mGetColRate,        mSetColRate,        2,  METH_NUM  },
      { mGetColFinalValue,  mSetColFinalValue,  2,  METH_NUM  },
      { mGetColFinalTime,   mSetColFinalTime,   2,  METH_TIME },
      { mGetColRate,        mSetColRate,        3,  METH_NUM  },
      { mGetColFinalValue,  mSetColFinalValue,  3,  METH_NUM  },
      { mGetColFinalTime,   mSetColFinalTime,   3,  METH_TIME },
      { mGetColPostValue,   mSetColPostValue,   0,  METH_NUM  }
};


const METHCMD mC1NR =
{
        MAXINDEX(mmXXNR, METHCMD_ENTRY),
        &mmXXNR[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mC2NR =
{
        MAXINDEX(mmXXNR, METHCMD_ENTRY),
        &mmXXNR[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};


/****************************************************************/
/****************************************************************/
/**                                                            **/
/**   C O L U M N   C A L I B R A T I O N   C O M M A N D S    **/
/**                                                            **/
/****************************************************************/
/****************************************************************/



static const METHCMD_ENTRY mmXXCC[] =
{
     {  mGetColCalibMode,       mSetColCalibMode,        0,   METH_NUM  },
     {  mGetColMeasFlow,        mSetColMeasFlow,         0,   METH_NUM  },
     {  mGetColHoldTime,        mSetColHoldTime,         0,   METH_RET_TIME }
};


const METHCMD mC1CC =
{
        MAXINDEX(mmXXCC, METHCMD_ENTRY),
        &mmXXCC[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mC2CC =
{
        MAXINDEX(mmXXCC, METHCMD_ENTRY),
        &mmXXCC[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};




static const METHCMD_ENTRY mmXXIC[] =
{
     {  mGetColLength,          mSetColLength,           0,   METH_NUM  },
     {  mGetColDiam,            mSetColDiam,             0,   METH_NUM  },
     {  mGetColFilmThick,       mSetColFilmThick,        0,   METH_NUM  },
     {  mGetColCalibMode,       mAcceptCalibMode,        0,   METH_NUM  },
     {  mGetColMeasFlow,        mAcceptColMeasFlow,      0,   METH_NUM  },
     {  mGetColHoldTime,        mAcceptColHoldTime,      0,   METH_RET_TIME  },
     {  mGetColCalibLength,     mAcceptCalibLength,      0,   METH_NUM  },
     {  mGetColCalibDiam,       mAcceptCalibDiam,        0,   METH_NUM  },
     {  mGetColCalibDate,       mAcceptCalibDate,        0,   METH_NUM  },
     {  mGetColIdString,        mSetColIdString,         0,   METH_QSTR }
};


const METHCMD mC1IC =
{
        MAXINDEX(mmXXIC, METHCMD_ENTRY),
        &mmXXIC[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mC2IC =
{
        MAXINDEX(mmXXIC, METHCMD_ENTRY),
        &mmXXIC[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};




static const METHCMD_ENTRY mmXXCF[] =
{
     {  mGetColLength,          mSetColLength,           0,   METH_NUM  },
     {  mGetColDiam,            mSetColDiam,             0,   METH_NUM  },
     {  mGetColFilmThick,       mSetColFilmThick,        0,   METH_NUM  },
     {  mGetColSource,          mSetColSource,           0,   METH_NUM  },
     {  mGetColOutlet,          mSetColOutlet,           0,   METH_NUM  },
     {  mGetColOutletPres,      mSetColOutletPres,       0,   METH_PRES },
     {  mGetColVacuumComp,      mSetColVacuumComp,       0,   METH_NUM  },
     {  mGetColOutletPresComp,  mSetColOutletPresComp,   0,   METH_NUM  }
};


const METHCMD mC1CF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mC2CF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXCW[] =
{
     {  mGetColLength,          mLetColLength,           0,   METH_NUM  },
     {  mGetColDiam,            mLetColDiam,             0,   METH_NUM  },
     {  mGetColFilmThick,       mLetColFilmThick,        0,   METH_NUM  },
     {  mGetColSource,          mLetColSource,           0,   METH_NUM  },
     {  mGetColOutlet,          mLetColOutlet,           0,   METH_NUM  },
     {  mGetColOutletPres,      mLetColOutletPres,       0,   METH_PRES },
     {  mGetColVacuumComp,      mLetColVacuumComp,       0,   METH_NUM  },
     {  mGetColOutletPresComp,  mLetColOutletPresComp,   0,   METH_NUM  }
};


const METHCMD mC1CW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (void *)&Inst_Status.Pneu.Column_1,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mC2CW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (void *)&Inst_Status.Pneu.Column_2,
        LockPneuWkfile,
        UnlockPneuWkfile
};

static INT32  mGetColMinPeakWidth  ( void *status, U_INT8 unused_parm )
{
     INT32 peak_width;

      (void)unused_parm;
   
      return ( EstimatedMinimumPeakWidth ( status, &peak_width ) == OK ) ? peak_width : 99999;
}


static INT32  mGetColRampType      ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return ( GetColumnRampType ( status ) == FLOW_RAMP );
}


static INT32  mGetColDefined       ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return ColumnDefined ( status );
}


static UI_ERR mTestColDefined      ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void)unused_parm;

      if ( ColumnDefined ( status ) == setpt ) return OK;
      else                                     return COMMAND_ABORTED;
}


static UI_ERR mTestColRampType     ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void)unused_parm;

      if ( ( GetColumnRampType ( status ) == FLOW_RAMP ) == setpt ) return OK;

      else                        return COMMAND_ABORTED;
}


static INT32 mGetColPresActual  ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColumnHeadPres( (pCOLUMN_STATUS) status );
}


static INT32 mGetColControlMode ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return (INT32)GetColumnControlMode ( (pCOLUMN_STATUS) status );
}


static INT32 mGetColInitValue ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
          return DcGetColInitFlow( (pCOLUMN_STATUS) status );
      }
      else
      {
          return DcGetColInitPres( (pCOLUMN_STATUS) status );
      }
}

static INT32 mGetColInitTime ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return GetColFlowInitTime( (pCOLUMN_STATUS)status );
}


static INT32 mGetColRate ( void *status, U_INT8 ramp_num )
{
      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
          return DcGetColFlowRate( (pCOLUMN_STATUS)status, ramp_num );
      }
      else
      {
          return DcGetColPresRate( (pCOLUMN_STATUS)status, ramp_num );
      }
}

static INT32 mGetColFinalValue ( void *status, U_INT8 ramp_num )
{
      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
          return DcGetColFlowFinalVal( (pCOLUMN_STATUS)status, ramp_num );
      }
      else
      {
          return DcGetColPresFinalVal( (pCOLUMN_STATUS)status, ramp_num );
      }
}

static INT32 mGetColFinalTime ( void *status, U_INT8 ramp_num )
{
      return GetColFlowFinalTime( (pCOLUMN_STATUS)status, ramp_num );
}



static INT32   mGetColPostValue(void *status, U_INT8 unused_parm)
{
      (void) unused_parm;

      if ( GetColumnRampType ( (pCOLUMN_STATUS)status ) == FLOW_RAMP )
      {
           return DcGetColumnPostFlow( (pCOLUMN_STATUS)status );
      }
      else
      {
           return DcGetColumnPostPres( (pCOLUMN_STATUS)status );
      }

}



static UI_ERR mSetColRate ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
           return DcSetColFlowRate( (pCOLUMN_STATUS)status, setpt, ramp_num );
      }
      else
      {
           return DcSetColPresRate( (pCOLUMN_STATUS)status, setpt, ramp_num );
      }
}


static UI_ERR mSetColPresSetpt   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetColumnHeadPres  ( setpt, (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColFlowSetpt   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetColumnVFlow      ( setpt, (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColVelSetpt   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetColumnAvgVel   ( setpt, (pCOLUMN_STATUS)status );
}


static UI_ERR mSetColControlMode ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetColumnControlMode( (CONTROL_MODE)setpt, (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColInitTime ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetColFlowInitTime( (pCOLUMN_STATUS)status, setpt );
}



static UI_ERR mSetColInitValue ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
           return DcSetColInitFlow( (pCOLUMN_STATUS)status, setpt );
      }
      else
      {
           return DcSetColInitPres( (pCOLUMN_STATUS)status, setpt );
      }
}

static UI_ERR mSetColFinalTime ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      return DcSetColFlowFinalTime( (pCOLUMN_STATUS)status, setpt, ramp_num );
}



static UI_ERR mSetColFinalValue ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      if ( GetRampType( ((pCOLUMN_STATUS)status)->Ramp_Info ) == FLOW_RAMP )
      {
           return DcSetColFlowFinalVal( (pCOLUMN_STATUS)status, setpt, ramp_num );
      }
      else
      {
           return DcSetColPresFinalVal( (pCOLUMN_STATUS)status, setpt, ramp_num );
      }
}



static UI_ERR  mSetColPostValue(void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      if ( GetColumnRampType ( (pCOLUMN_STATUS)status ) == FLOW_RAMP )
      {
           return DcSetColumnPostFlow( setpt, (pCOLUMN_STATUS)status );
      }
      else
      {
           return DcSetColumnPostPres( setpt, (pCOLUMN_STATUS)status );
      }
}



static INT32  mGetColFlow          ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

    return DcGetColumnVFlow( (pCOLUMN_STATUS)status );
}


static INT32  mGetColVel           ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

    return DcGetColumnAvgVelocity ( (pCOLUMN_STATUS)status );
}


static INT32  mGetColLength        ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return GetColumnLength( (pCOLUMN_STATUS)status );
}

static INT32  mGetColDiam          ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return GetColumnDiam(  (pCOLUMN_STATUS)status );
}

static INT32  mGetColFilmThick     ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return GetColumnFilmThickness(  (pCOLUMN_STATUS)status );
}

static INT32  mGetColSource        ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return (INT32)GetColumnSource(  (pCOLUMN_STATUS)status );
}

static INT32  mGetColOutlet        ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return (INT32)GetColumnOutlet(  (pCOLUMN_STATUS)status );
}

static INT32  mGetColVacuumComp    ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return (INT32)GetColumnVacuumComp( (pCOLUMN_STATUS)status );
}

static INT32  mGetColOutletPresComp( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return (INT32)ColumnOutletPresCompEnabled( (pCOLUMN_STATUS)status );
}

static INT32  mGetColOutletPres    ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColumnOutletPresCompSetpt( (pCOLUMN_STATUS)status );
}

static INT32  mGetColCalibMode     ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColumnCalibMode  (  (pCOLUMN_STATUS)status );
}

static INT32  mGetColCalibLength   ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColCalibLength(  (pCOLUMN_STATUS)status );
}

static INT32  mGetColCalibDiam    ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColCalibDiam( (pCOLUMN_STATUS)status );
}

static INT32  mGetColCalibDate( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColCalibDate( (pCOLUMN_STATUS)status );
}

static INT32  mGetColMeasFlow     ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColMeasFlow ( (pCOLUMN_STATUS)status );
}

static INT32  mGetColHoldTime ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcGetColumnCalibHoldTime ( (pCOLUMN_STATUS)status );
}

static INT32  mGetColIdString    ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

       /* really returns a char pointer */

      return (INT32)DcGetColumnIdString( (pCOLUMN_STATUS)status );
}




static UI_ERR mSetColLength        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnLength( setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColDiam          ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnDiam( setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColFilmThick     ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnFilmThickness( setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColSource        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnSource( (SOURCE_CONNECTION)setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColOutlet        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnOutlet( (OUTLET_CONNECTION)setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColVacuumComp    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return SetColumnVacuumComp( (ON_OFF)setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColOutletPresComp( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return SetColumnOutletPresComp( (ON_OFF)setpt,  (pCOLUMN_STATUS)status );
}

static UI_ERR mSetColOutletPres    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColumnOutletPresCompSetpt( setpt,  (pCOLUMN_STATUS)status );
}



static UI_ERR mSetColCalibMode       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcSetColCalibMode  ( (pCOLUMN_STATUS)status, (CALIB_MODE)setpt );
}


static UI_ERR mSetColMeasFlow           ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      if ( setpt == 0 )
      {
          (void)DcAcceptColMeasFlow( status, 0 );
          return OK;
      }
      else
      {
          if ( GetColumnCalibMode( status )  == LENGTH_AND_DIAM )
          {
              /* this parameter would normally error, since the next param (hold time) */
              /* is required for the calibration.  So, happily try this param, and     */
              /* return ok.  let the next param really perform the calibration.        */
              (void) DcSetColMeasFlow ( (pCOLUMN_STATUS)status, setpt );
              return OK;
          }
          else
          {
              return DcSetColMeasFlow ( (pCOLUMN_STATUS)status, setpt );
          }
      }
}


static UI_ERR mSetColHoldTime        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
    
      if ( setpt == 0 )
      {
          (void)DcAcceptColHoldTime( status, 0 );
          return OK;
      }
      else
      {
          return DcSetColHoldTime   ( (pCOLUMN_STATUS)status, setpt );
      }
}

static UI_ERR mSetColIdString           ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      /* setpt is really a char pointer */

      return DcSetColumnIdString ((pCOLUMN_STATUS)status, (char *)setpt );
}



static UI_ERR mAcceptCalibMode       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptCalibMode  ( (pCOLUMN_STATUS)status, setpt );
}



static UI_ERR mAcceptColMeasFlow           ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptColMeasFlow ( (pCOLUMN_STATUS)status, setpt );
}


static UI_ERR mAcceptColHoldTime        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptColHoldTime   ( (pCOLUMN_STATUS)status, setpt );
}




static UI_ERR mAcceptCalibLength     ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptCalibLength( (pCOLUMN_STATUS)status, setpt );
}

static UI_ERR mAcceptCalibDiam          ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptCalibDiam( (pCOLUMN_STATUS)status, setpt );
}


static UI_ERR mAcceptCalibDate       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      return DcAcceptCalibDate  ( (pCOLUMN_STATUS)status, setpt );
}


#define pneu_status ((pCOLUMN_STATUS)status)

static UI_ERR mLetColLength        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColLength[ pneu_status->Position == 1 ? 0 : 1 ] = setpt;

   return OK;
}

static UI_ERR mLetColDiam          ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColDiam  [ pneu_status->Position == 1 ? 0 : 1 ] = setpt;

   return OK;
}

static UI_ERR mLetColFilmThick     ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColFilmThick[ pneu_status->Position == 1 ? 0 : 1 ] = setpt;

   return OK;
}

static UI_ERR mLetColSource        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColSource[ pneu_status->Position == 1 ? 0 : 1 ] = (SOURCE_CONNECTION)setpt;

   return OK;
}

static UI_ERR mLetColOutlet        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColOutlet[ pneu_status->Position == 1 ? 0 : 1 ] = (OUTLET_CONNECTION)setpt;

   return OK;
}

static UI_ERR mLetColVacuumComp    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColVacuumComp[ pneu_status->Position == 1 ? 0 : 1 ] = (ON_OFF)setpt;

   return OK;
}

static UI_ERR mLetColOutletPresComp( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColOutletPresCompEnabled[ pneu_status->Position == 1 ? 0 : 1 ] = (TRUE_FALSE)setpt;

   return OK;
}

static UI_ERR mLetColOutletPres    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
   (void)unused_parm;

   gccw.ColOutletPresCompSetpt[ pneu_status->Position == 1 ? 0 : 1 ] = setpt;

   return OK;
}

